import Vue from 'vue'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss' // global css
import App from './App'
import store from './store'
import router from './router'
import * as filters from '@/api/filters/index'
for (const key in filters) {
  Vue.filter(key, filters[key])
}
import i18n from '@/lang/index'
import '@/icons' // icon
import '@/permission' // permission control
import * as directives from './directives/index'
import component from '@/components'
Vue.use(component)
Object.keys(directives).forEach(item => Vue.directive(item, directives[item]))
Vue.config.productionTip = false

Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})

new Vue({
  i18n,
  el: '#app',
  router,
  store,
  render: h => h(App)
})
